package com.yu.waterstation.app.moudles.worker.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yu.waterstation.common.entity.app.Worker;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface WorkerMapper extends BaseMapper<Worker> {
    /**
     * 解除微信绑定
     * @param id
     */
    @Update("update worker set wx_openid = NULL, wx_avatar = NULL where id = #{id}")
    int unbindWeiXin(@Param("id") Integer id);

    /**
     * 删除openid 在绑定微信的时候用到 确保一个微信不绑定多个账号
     * @param openid
     */
    @Update("update worker set wx_openid = NULL where wx_openid = #{openid}")
    int deleteOpenid(@Param("openid") String openid);

}
